/*
 * @Description: 标题栏
 * @Author: buwei.huang
 * @Date: 2019-09-04 14:18:17
 * @Last Modified by: buwei.huang
 * @Last Modified time: 2019-09-04 17:11:41
 */
<template>
  <title-bar
    :needBorder="false"
    :needBack="false"
    ref="title_bar"
  >
    <div>
      <img
        class="img_goBack"
        src="../assets/goBack.png"
        @click="goBack"
      />
    </div>
  </title-bar>
</template>
<script>
import { TitleBar } from 'vue-xb-ui-depot'
export default {
  components: {
    'title-bar': TitleBar
  },
  mounted() {
    // console.warn('this.$refs', this.$refs.title_bar.titleBarHeight)
    let timer = setInterval(() => {
      if (this.$refs.title_bar.titleBarHeight) {
        console.warn(this.$refs.title_bar.titleBarHeight)
        this.$emit('setHeight', this.$refs.title_bar.titleBarHeight)
        clearInterval(timer)
      }
    }, 100)
  },
  methods: {
    goBack() {
      this.$AppRouterUtils.goBack()
    }
  }
}
</script>
<style>
.img_goBack {
  width: 48px;
  height: 48px;
  margin: 16px 0 0 32px;
}
</style>
